home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / circuits / spice2g6.z / spice2g6 / spice / Fortran / keysrc.f < prev    next >
Encoding:
Text File  |  1989-02-03  |  820 b   |  35 lines

  1.       subroutine keysrc(keytab,lentab,tstwrd,index)
  2.       implicit double precision (a-h,o-z)
  3.       double precision keytab
  4. c
  5. c     this routine searches the keyword table 'keytab' for the possible
  6. c entry 'tstwrd'.  abbreviations are considered as matches.
  7. c
  8.       dimension keytab(lentab)
  9.       integer xxor
  10.       data ablnk / 1h  /
  11. c
  12. c
  13.       index=0
  14.       lenwrd=0
  15.       achar=ablnk
  16.       do 10 i=1,8
  17.       call move(achar,8,tstwrd,i,1)
  18.       if (achar.eq.ablnk) go to 20
  19.       lenwrd=lenwrd+1
  20.    10 continue
  21. c
  22.    20 if (lenwrd.eq.0) go to 40
  23.       tstchr=ablnk
  24.       call move(tstchr,8,tstwrd,1,1)
  25.    30 index=index+1
  26.       if (index.gt.lentab) go to 40
  27.       akey=ablnk
  28.       call move(akey,1,keytab(index),1,lenwrd)
  29.       if (xxor(akey,tstwrd).eq.0) go to 50
  30.       go to 30
  31. c
  32.    40 index=-1
  33.    50 return
  34.       end
  35.